<?php
namespace Dbak\Controller;
use Dbak\lib\PhpMysqlBackup;
use Think\Controller;

/**
 * Class AdminController
 * @package Dbak\Controller
 * 后台模块
 */
class AdminController extends Controller {
    public function index(){

    }

    public function back_up(){
        //C('DB_NAME')
        $option = array(
            'host' => C('DB_HOST'),
            'username' => C('DB_USER'),
            'password' => C('DB_PWD'),
            'charset' => C('DB_CHARSET'),
            'database' => '7af',
            'backupFloder' => C('DB_BACKUP_DIR').date('YmdHis').'/',
            'errorLog' => C('DB_BACKUP_DIR').'backup_error_log.log',
            'blockSize' => 2048,
        );
        $backup = new PhpMysqlBackup();
        $backup->init($option);
    }
}